<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>沂水旅游-个人中心</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css">
    <link rel="stylesheet" href="/static/index/css/base.css">
    <link rel="stylesheet" href="/static/index/css/my.css">

</head>
<body>

{include file="public/header" model='other' /}
{include file="public/myheader" model='other' /}

<div class="my-box-width">

    <div class="my-other-user">

        <div class="bord-title">个人信息</div>
        <div class="my-other-user-info">

            <form class="layui-form" action="">
                <div class="layui-form-item">

                    <div class="layui-inline">
                        <label class="layui-form-label">头像:</label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <a class="layui-btn" id="upload_icon" href="javascript:;">修改头像</a>
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label">昵称:</label>
                        <div class="layui-input-inline" style="width: 160px;">
                            <input type="text" value="{$data.nickname}" id="eidtNickName" name="" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label">性别:</label>
                        <div class="layui-input-inline" style="width: 120px;">
                            <select name="city" lay-verify="" lay-filter="userSex">
                                <option value="">未设置</option>
                                <option value="2" {eq name="data.sex" value="2"}selected{/eq}>男</option>
                                <option value="1" {eq name="data.sex" value="1"}selected{/eq}>女</option>
                            </select>
                        </div>
                    </div>

                </div>
            </form>

        </div>

    </div>
    <div class="my-other-apply" id="apply">

        <div class="bord-title">申请入驻</div>
        <div class="apply-select">

            <div class="layui-fluid">
                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="select_every">
                            <div class="the-apply-kinds the-apply-kinds-1">酒店业务</div>
                            <div class="the-apply-tig">沂水本地酒店民宿商家入驻</div>
                            <div class="the-apply-a">
                                {switch name="data.hotel_store_status"}
                                    {case value="0"}<a href="javascript:;">等待审核</a>{/case}
                                    {case value="1"}<a href="javascript:;">入驻成功</a>{/case}
                                    {case value="2"}<a href="javascript:;">审核未通过</a>{/case}
                                    {case value="3"}<a href="{:url('my/applyHotel')}">申请入驻</a>{/case}
                                {/switch}

                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="select_every">
                            <div class="the-apply-kinds the-apply-kinds-2">美食业务</div>
                            <div class="the-apply-tig">沂水本地特色美食商家入驻</div>
                            <div class="the-apply-a">
                                {switch name="data.food_store_status"}
                                    {case value="0"}<a href="javascript:;">等待审核</a>{/case}
                                    {case value="1"}<a href="javascript:;">入驻成功</a>{/case}
                                    {case value="2"}<a href="javascript:;">审核未通过</a>{/case}
                                    {case value="3"}<a href="{:url('my/applyFood')}">申请入驻</a>{/case}
                                {/switch}
                            </div>
                        </div>
                    </div>

                    <div class="layui-col-md4">
                        <div class="select_every">
                            <div class="the-apply-kinds the-apply-kinds-3">跟团业务</div>
                            <div class="the-apply-tig">沂水本地旅行团旅行社商家入驻</div>
                            <div class="the-apply-a">
                                {switch name="data.team_store_status"}
                                    {case value="0"}<a href="javascript:;">等待审核</a>{/case}
                                    {case value="1"}<a href="javascript:;">入驻成功</a>{/case}
                                    {case value="2"}<a href="javascript:;">审核未通过</a>{/case}
                                    {case value="3"}<a href="{:url('my/applyTour')}">申请入驻</a>{/case}
                                {/switch}
                                
                            </div>
                        </div>
                    </div>

                </div>
            </div>

        </div>

    </div>

    {eq name="data.food_store_status" value="1"}

    <div class="my-other-controller">
        <div class="bord-title">业务管理</div>
        <div class="the-controller">
            <div class="the-controller-ever">
                <a href="{:url('My/foodController')}">
                    <div class="ever-icon">
                        <img src="/static//index/images/meishi_icon.png" alt="">
                    </div>
                    <div class="ever-title">美食管理</div>
                </a>
            </div>
        </div>

    </div>
    {/eq}

</div>

<div style="height: 100px"></div>

{include file="public/footer" /}

<script>
    var $ = layui.jquery;
        var layer = layui.layer
            , element = layui.element
            , upload = layui.upload
            , form = layui.form;


            form.render();
        //普通图片上传
        var uploadInst = upload.render({
            elem: '#upload_icon'
            ,url: "{:url('My/uploadUserIcon')}"
            ,before:function(){
                var loading = layer.load(1, {
                    shade: [0.1,'#fff'] //0.1透明度的白色背景
                });
            }
            ,done: function(res){
                if (res.code == 1){
                    return layer.msg(res.msg,{time:1500},function(){
                        window.location.reload();
                    });
                }else{
                    return layer.msg(res.msg);
                }
            }
        });

        $('#eidtNickName').bind('blur',function(){

            var loading = layer.load(1, {
                shade: [0.1,'#fff'] //0.1透明度的白色背景
            });

            var nickname = $('#eidtNickName').val();

            $.ajax({
                url: "{:url('My/editNickName')}",
                type: 'post',
                dataType: 'json',
                data: {nickname:nickname},
                success: function(msg){
                    layer.closeAll();
                    if (msg.code != 1){
                        layer.msg('修改失败',{icon:2,time:1000},function(){
                            window.location.reload();
                        });

                    }
                }
            });

        });

        form.on('select(userSex)', function(data){
            if (data.value != ''){

                var loading = layer.load(1, {
                    shade: [0.1,'#fff'] //0.1透明度的白色背景
                });

                $.ajax({
                    url: "{:url('My/editSex')}",
                    type: 'post',
                    dataType: 'json',
                    data: {sex:data.value},
                    success: function(msg){
                        layer.closeAll();
                        if (msg.code != 1){
                            layer.msg('修改失败',{icon:2,time:1000},function(){
                                window.location.reload();
                            });

                        }
                    }
                });

            }
        });

</script>
</body>
</html>